package com.sessionFactory.util;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class SqlSessionFactoryUtil {
	
	public static SqlSession getSqsession(){
		SqlSession se=null;
		InputStream in=null;
		try {
		in = Resources.getResourceAsStream("SqlMapConfig.xml");
		
		SqlSessionFactory build = new SqlSessionFactoryBuilder().build(in);
		
		 se= build.openSession();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return se;
	}
}
